﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Downloader.UI
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        
        private void btnSum_Click(object sender, EventArgs e)
        {
            string[] tempData = this.textBox1.Text.Trim().Split('+');
            int sum = 0;
            for (int i = 0; i < tempData.Length; i++)
            {
                sum = sum + Convert.ToInt32(tempData[i]);
            }

            this.lbSum.Text = sum.ToString();
        }

        private void btnAssociate_Click(object sender, EventArgs e)
        {
            int sum = Convert.ToInt32(this.textBox3.Text.Trim());
            int temp = Convert.ToInt32(this.textBox2.Text.Trim());

            int result = sum & temp;

            this.lbResult.Text = result.ToString();
        }
    }
}
